package 实体;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

import java.util.Set;

public class RedisPool {
    private static Jedis jedis;
    static {initpool();}
    private static void initpool(){
        jedis=new Jedis("127.0.0.1",6379);

    }
    public static Jedis getJedis(){
        return jedis;
    }

    public static void main(String[] args) {
        Jedis jedis=RedisPool.getJedis();
        String result=jedis.ping();
        System.out.println(result);
        jedis.close();
    }
}
